home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_xemacs.idb / usr / freeware / lib / xemacs-20.4 / lisp / ilisp / ilisp-val.el.z / ilisp-val.el
Encoding:
Text File  |  1998-05-21  |  1.3 KB  |  49 lines

  1. ;;; -*- Mode: Emacs-Lisp -*-
  2.  
  3. ;;; ilisp-val.el --
  4.  
  5. ;;; This file is part of ILISP.
  6. ;;; Version: 5.8
  7. ;;;
  8. ;;; Copyright (C) 1990, 1991, 1992, 1993 Chris McConnell
  9. ;;;               1993, 1994 Ivan Vasquez
  10. ;;;               1994, 1995, 1996 Marco Antoniotti and Rick Busdiecker
  11. ;;;               1996 Marco Antoniotti and Rick Campbell
  12. ;;;
  13. ;;; Other authors' names for which this Copyright notice also holds
  14. ;;; may appear later in this file.
  15. ;;;
  16. ;;; Send mail to 'ilisp-request@naggum.no' to be included in the
  17. ;;; ILISP mailing list. 'ilisp@naggum.no' is the general ILISP
  18. ;;; mailing list were bugs and improvements are discussed.
  19. ;;;
  20. ;;; ILISP is freely redistributable under the terms found in the file
  21. ;;; COPYING.
  22.  
  23.  
  24.  
  25. ;;;
  26. ;;; ILISP buffer value interface
  27. ;;;
  28. ;;;
  29.  
  30. ;;;
  31. (defun ilisp-value (variable &optional no-error-p)
  32.   "Return the value of VARIABLE in the ILISP buffer.
  33. If NO-ERROR-P is NIL, then an error will be signalled if VARIABLE is nil."
  34.   (save-excursion
  35.     (set-buffer (ilisp-buffer))
  36.     (let ((value (eval variable)))
  37.       (if value
  38.       value
  39.       (if no-error-p
  40.           nil
  41.           (error "%s is not defined." variable))))))
  42.  
  43. ;;;
  44. (defun set-ilisp-value (variable value)
  45.   "Set the value of VARIABLE in the ILISP buffer."
  46.   (save-excursion
  47.     (set-buffer (ilisp-buffer))
  48.     (set variable value)))
  49.